package com.fhz.module_main.viewmodel

import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import com.fhz.loginmvvm.callback.ApiResponse
import com.fhz.module_main.entity.UserEntity
import com.fhz.module_main.repository.IndexRepository
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

/**
 * 时间:2023/4/25
 * @author Mr.Feng
 * 简述: shouye
 */
@HiltViewModel
class IndexViewModel @Inject constructor(private val repository: IndexRepository) : ViewModel()  {

    fun login(name:String,pwd:String) : LiveData<ApiResponse<UserEntity>> {
        return repository.login(name,pwd)
    }

//    fun insertUser(user: User){
//        viewModelScope.launch {
//            repository.insertUser(user)
//        }
//    }
}